<?php
require_once 'command/Command.php';
require_once 'database/User.php';
require_once 'database/DatabaseConnection.php';

class CreateUserCommand implements Command{
	
	private $name;
	private $password;
	private $user;
	
	public function __construct($name, $password){
		$this->name = $name;
		$this->password = $password;
		$this->user = new User();
	}
	
	public function execute(){
		DatabaseConnection::connect();
		$bool = $this->user->createUser($this->name, $this->password);
		DatabaseConnection::disconnect();
		$string = "<succes>".$bool."</succes>";
		return $string;
	}
}